﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.BLL;
using Automobile.service.Model;
using System.Data;

namespace Automobile.service.UI
{
    public partial class WareHose_Add : System.Web.UI.Page
    {
        WareHoseBLL bll = new WareHoseBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {

            WareHose wh = new WareHose();
            wh.WareHose_Name = this.WareHose_Name.Value;
            wh.WareHose_People = this.WareHose_People.Value;
            wh.WareHose_Phone = this.WareHose_Phone.Value;
            wh.WareHose_Address = this.WareHose_Address.Value;
            wh.WareHose_Remark = this.WareHose_Remark.Value;
            if (bll.AddWareHose(wh) > 0)
            {
                JournalBLL jbll = new JournalBLL();
                jbll.AddJourna_AddWareHose(Convert.ToInt32(Session["empid"]),wh);
                Response.Write("<script>alert('添加成功！');parent.location.reload();parent.layer.close(parent.layer.getFrameIndex(window.name));</script>");

            }
            else
            {
                Response.Write("<script>alert('添加失败！');parent.layer.close(parent.layer.getFrameIndex(window.name));</script>");
            }
        }
    }
}